---
title: "When Redistribution Backfires Politically: Theory and Evidence from Land Reform in Portugal"
subtitle: "Replication Material, Journal of Politics Dataverse"
author: 
  - Michael Abertus, University of Chicago
  - Noah Schouela, University of Chicago
date: January 2024
output: pdf_document
---

# Description
The data and code provided replicates the analysis found in Albertus and Schouela (2024), "When Redistribution Backfires Politically: Theory and Evidence from Land Reform in Portugal" and the associated appendix. 

# Files 
1. Rmd Files -- Rmd files 1-22 reproduce all of the analysis found in the paper and appendix. They are largely in order, based on the analysis, first, in the paper and, second, in the appendix; "R1.Figures.Rmd" is an exception as it generates all of the maps and select figures found throughout the paper and appendix. 
2. Code Legend -- This spreadsheet describes what each Rmd file does and which figures/tables it produces in the paper and appendix.
3. Dictionary -- This spreadsheet lists and describes the variables found in each dataset.
4. "Data" Folder -- This folder contains all of the datasets necessary to reproduce the results.
5. "Figures" Folder -- This folder contains PDFs of all figures reproduced by the provided code. 

# Datasets

1. data_final.Rdata -- This data.frame contains the main cross-sectional variables used in the analysis. 
2. gnr_panel.Rdata -- This list of data.frames indicates the cumulative number of GNR events in each parish prior to each election cycle.
3. gnr_events.Rdata -- This data.frame provides the date of each GNR event across parishes over time (used in R1)
4. points_soiltype.Rdata -- This data.frame indicates the average points allocated for different soil types (used in R8).
5. ian_points.Rdata -- This data.frame indicates the points and taxable income of distinct properties in Idanha-a-Nova (used in R9).
6. cadastre_points.Rdata -- This data.frame provides the year in which each municipal cadastre was generated (used in R10). 
7. ideo_list.Rdata -- This list of data.frames indicates the vote shares received by parties belonging to each of the four ideological groupings in each election for ZIRA. 
8. nation_ideo.Rdata -- This list of data.frames indicates the vote shares received by parties belonging to each of the four ideological groupings in each election nationally. 
9. party_list.Rdata -- This list of data.frames indicates the vote shares received by specific parties on the Center-Left (PS) and Right (PPD/PSD) in each election for ZIRA. 
10. turnout_list.Rdata -- This list of data.frames indicates the voter turnout in each election for ZIRA.
11. voters_list.Rdata -- This list of data.frames indicates the votes received by parties belonging to each of the four ideological groupings in each election for ZIRA. 
12. DG_Z_Shp.Rdata -- This "sf object" contains the spatial polygons of each parish in ZIRA, with some agglomerated to account for changes to administrative boundaries over time. 
13. DICOFRE_names.Rdata -- This "sf object" provides the names of each parish, municipality, and district as well as their agglomeration codes. 
14. zira_portugal.Rdata -- This list of "sf objects" includes (1) a polygon of the ZIRA region and (2) a polygon of Portugal's national boundaries. 

# Figures

The "Figures" folder includes most of the figures reproduced in the paper and appendix. Their titles indicate where they belong in either document.

Figures that start with "fg" are in the paper and the numbers and letter following indicate their Figure Number in the paper. For example, "fg1a_Map_ZIRA.pdf" indicates that the map is in Figure 1 of the paper in the first panel (a).

Figures that start with "A" are in the appendix and are indexed to indicate in what section of the appendix they are located. For example, "Afg1a1.1_GNREvents.pdf" indicates that the plot is in the Appendix, section 1.a)i and appears first (.1). 

# Software

Code for this paper was prepared using R version 4.3.2 (2023-10-31) -- "Eye Holes".

# R Packages

* tidyverse, 2.0.0
* lubridate, 1.9.3
* sf, 1.0-14
* tmap, 3.3-4
* estimatr, 1.0.0
* gridExtra, 2.3
* stargazer, 5.2.3
* sandwich, 3.0-2

